<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddInfoToUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->string('email', 30)->default('')->nullable()->change();
            $table->string('mobile', 12)->default('')->nullable()->after('email')->comment('联系电话');
            $table->tinyInteger('gender')->default(0)->after('email')->comment('性别：0未知，1男，2女');
            $table->tinyInteger('is_married')->default(0)->after('email')->comment('结婚状态：1是，2否');
            $table->tinyInteger('is_move_out')->default(0)->after('email')->comment('户口是否迁出：1是，2否');
            $table->tinyInteger('is_foreign')->default(0)->after('email')->comment('是否外来户口：1是，2否');
            $table->tinyInteger('is_die')->default(2)->after('email')->comment('是否死亡：1是，2否');
            $table->tinyInteger('household')->default(2)->after('email')->comment('户主：1是，2否');
            $table->tinyInteger('identity_type')->default(1)->after('email')->comment('身份类型：1普通，2独生子女，3双女');
            $table->tinyInteger('family_id')->default(0)->after('email')->comment('家庭ID');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            //
        });
    }
}
